package com.kayt.cyberBar.cuser.business.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kayt.cyberBar.common.PageData;
import com.kayt.cyberBar.common.ServerResponse;
import com.kayt.cyberBar.cuser.business.entity.po.BCyberBaseTaskReport;
import com.kayt.cyberBar.cuser.business.entity.vo.CyberBaseTaskQueryVO;
import com.kayt.cyberBar.cuser.business.entity.vo.CyberBaseTaskReportVO;
import com.kayt.cyberBar.cuser.business.server.ICyberBaseTaskReportServer;
import com.kayt.cyberBar.cuser.business.service.ICyberBaseTaskReportService;

@Service("iCyberBaseTaskReportService")
public class CyberBaseTaskReportServiceImpl implements ICyberBaseTaskReportService {

	@Autowired
	private ICyberBaseTaskReportServer iCyberBaseTaskReportServer;
	
	@Override
	public ServerResponse<CyberBaseTaskReportVO> addReport(CyberBaseTaskReportVO vo) {
		BCyberBaseTaskReport report = this.iCyberBaseTaskReportServer.add_report(vo);
		ServerResponse<CyberBaseTaskReportVO> rsp = this.iCyberBaseTaskReportServer.assemble_result(report);
		return rsp;
	}
	
	@Override
	public ServerResponse<String> updateReport(CyberBaseTaskReportVO vo) {
		int result = this.iCyberBaseTaskReportServer.update_report(vo);
		ServerResponse<String> rsp = this.iCyberBaseTaskReportServer.assemble_result_string(result);
		return rsp;
	}
	
	@Override
	public ServerResponse<CyberBaseTaskReportVO> getReport(CyberBaseTaskReportVO vo) {
		BCyberBaseTaskReport report = this.iCyberBaseTaskReportServer.get_report(vo);
		ServerResponse<CyberBaseTaskReportVO> rsp = this.iCyberBaseTaskReportServer.assemble_result(report);
		return rsp;
	}
	
	@Override
	public ServerResponse<PageData<CyberBaseTaskReportVO>> getReportList(CyberBaseTaskQueryVO query) {
		PageData<BCyberBaseTaskReport> reportData = this.iCyberBaseTaskReportServer.get_report_list(query);
		ServerResponse<PageData<CyberBaseTaskReportVO>> rsp = this.iCyberBaseTaskReportServer.assemble_result_list(reportData);
		return rsp;
	}
}
